#include "Framework.h"
#include "TestCase.h"
#include "TestData.h"
#include "TimeCostRecord.h"

void Framework::AddTestCase( TestCase* pTestCase )
{
    vecTestCase.push_back(pTestCase);
}

void Framework::SetUpData(int* pData, int iLen)
{
    TestCaseVector::iterator it = vecTestCase.begin();
    for (; it != vecTestCase.end(); ++it)
    {
        (*it)->SetUpData(pData, iLen);
    }
}

void Framework::StartTest(TestData* pTestData)
{
    TestCaseVector::iterator it = vecTestCase.begin();
    for (; it != vecTestCase.end(); ++it)
    {
        TimeCostRecord oRecord((*it)->GetName().c_str());
		int iKey = pTestData->GetKey();
        for (int i = 0; i < iLoopCount; ++i)
        {
            (*it)->Test(iKey);
        }
    }
}

